<?php

namespace Database\Seeders;

use App\Models\Question;
use Illuminate\Database\Seeder;

class QuestionSeed extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $questions = [
            ['user_id' => 2, 'title' => '西游记中西天取经队伍中的猴子叫什么名字', 'category_id' => rand(11, 16), 'type' => 'radio', 'content' => '西游记中西天取经队伍中的猴子叫什么名字', 'status' => 1, 'fraction' => 10, 'success_answer' => '66', 'answer' => ['65' => '唐僧', '66' => '孙悟空', '67' => '猪八戒', '68' => '沙和尚',]],
            ['user_id' => 2, 'title' => '西游记中西天取经队伍中的猪妖叫什么名字', 'category_id' => rand(11, 16), 'type' => 'radio', 'content' => '西游记中西天取经队伍中的猪妖叫什么名字', 'status' => 1, 'fraction' => 10, 'success_answer' => '67', 'answer' => ['65' => '唐僧', '66' => '孙悟空', '67' => '猪八戒', '68' => '沙和尚',]],
            ['user_id' => 2, 'title' => '西游记中西天取经的队伍中都有谁', 'category_id' => rand(11, 16), 'type' => 'checkbox', 'content' => '西游记中西天取经得队伍中都有谁', 'status' => 1, 'fraction' => 10, 'success_answer' => [65,66,67,68], 'answer' => ['65' => '唐僧', '66' => '孙悟空', '67' => '猪八戒', '68' => '沙和尚',]],
            ['user_id' => 2, 'title' => '西游记中西天取经的队伍中都有谁', 'category_id' => rand(11, 16), 'type' => 'checkbox', 'content' => '西游记中西天取经得队伍中都有谁', 'status' => 1, 'fraction' => 10, 'success_answer' => [65,66], 'answer' => ['65' => '唐僧', '66' => '孙悟空', '67' => '观音', '68' => '如来佛祖',]],
            ['user_id' => 2, 'title' => '西游记中西天取经的队伍中有[*],[*],[*],[*]', 'category_id' => rand(11, 16), 'type' => 'fill', 'content' => '西游记中西天取经的队伍中有[*],[*],[*],[*]', 'status' => 1, 'fraction' => 10, 'success_answer' => '4[唐僧,孙悟空,猪八戒,沙和尚]', 'answer' => ''],
            ['user_id' => 2, 'title' => '西游记中西天取经的队伍中有[*],[*]', 'category_id' => rand(11, 16), 'type' => 'fill', 'content' => '西游记中西天取经的队伍中有[*],[*]', 'status' => 1, 'fraction' => 10, 'success_answer' => '2[唐僧,孙悟空,猪八戒,沙和尚]', 'answer' => ''],
            ['user_id' => 2, 'title' => '西游记中如意金箍棒是属于孙悟空的', 'category_id' => rand(11, 16), 'type' => 'judge', 'content' => '西游记中如意金箍棒是属于孙悟空的', 'status' => 1, 'fraction' => 10, 'success_answer' => true, 'answer' => ''],
            ['user_id' => 2, 'title' => '西游记中如意金箍棒是属于唐僧的', 'category_id' => rand(11, 16), 'type' => 'judge', 'content' => '西游记中如意金箍棒是属于唐僧的', 'status' => 1, 'fraction' => 10, 'success_answer' => false, 'answer' => ''],
        ];

        foreach ($questions as $value) {
            Question::create($value);
        }
    }
}
